package com.java.jvm.loader;

public class TestClassLoader03 {
	public static void doMethod01() {
		  ClassLoader loader=ClassLoader.getSystemClassLoader();
		  System.out.println(loader);//AppClassLoader
		  System.out.println(loader.getParent());//ExtClassLoader
		  System.out.println(loader.getParent().getParent());//null(BootstrapClassLoader)
	}
	public static void doMethod02() {
		ClassLoader loader = Thread.currentThread().getContextClassLoader();
		System.out.println(loader);
		System.out.println(loader.getParent());
		System.out.println(loader.getParent().getParent());
	}
	public static void doMethod03() throws ClassNotFoundException {
	    System.out.println("Classloader of this class:"
	        + TestClassLoader03.class.getClassLoader());//AppClassLoader
	    System.out.println("Classloader of object:"
	        + Object.class.getClassLoader());//BootstrapClassLoader
	}
	public static void main(String[] args)throws Exception {
		doMethod01();
		doMethod02();
		doMethod03();
	}
}
